package cn.org.xuanzp.examples.v1;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.handler.codec.serialization.ClassResolvers;
import io.netty.handler.codec.serialization.ObjectDecoder;
import io.netty.handler.codec.serialization.ObjectEncoder;

/**
 * 
 * @author hy
 * @createTime 2021-04-17 10:11:10
 * @description 一个ftp服务器的初始化pipline主要添加对象传输功能
 *
 */
public class NettyFtpServerChannelInitializer extends ChannelInitializer<Channel> {
	
	@Override
	protected void initChannel(Channel ch) throws Exception {
		ch.pipeline()
		.addLast(new ObjectDecoder(ClassResolvers.cacheDisabled(null)))
		.addLast(new NettyFtpServerHandler())
		.addLast(new ObjectEncoder());
	}
	

}
